﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ClassDemo
{
    class Program
    {
        static void Main(string[] args)
        {
          
           

            Employee[] employees = new Employee[5];
            for(int i=0; i<5; i++)
            {
                Employee newEmployee = new Employee();
                newEmployee.AddEmployeeInfo();
                employees[i] = newEmployee;

            }
            int sumSalary = 0;
            foreach(var empl in employees)
            {
                sumSalary += empl.salary;

            }
            Console.WriteLine("Суммарная зп {0}", sumSalary);


        }

        class Employee
        {
            public string firstName;
            public string lastName;
            public int salary;

            public void PrintInfo()
            {
                Console.WriteLine("Меня зовут {0} {1}", firstName, lastName);

            }
            public void AddEmployeeInfo()
            {
                Console.WriteLine("Введите имя:");
                firstName = Console.ReadLine();
                Console.WriteLine("Введите фамилия:");
                lastName = Console.ReadLine();
                Console.WriteLine("Введите ЗП:");
                salary = Int32.Parse(Console.ReadLine());
            }


        }

    }
}